const { ccclass, property } = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    /**滚动列表节点 */
    ScrollList = new cc.Node();

    onLoad() {
        //测试的数据
        //少量数据
        //let data = [{ rank: 1, nick: "player1" }, { rank: 2, nick: "player2" }, { rank: 3, nick: "player3" }];
        //大量数据
        let data = [{ rank: 1, nick: "player1" }, { rank: 2, nick: "player2" }, { rank: 3, nick: "player3" },
        { rank: 4, nick: "player4" }, { rank: 5, nick: "player5" }, { rank: 6, nick: "player6" },
        { rank: 7, nick: "player7" }, { rank: 8, nick: "player8" }, { rank: 9, nick: "player9" },
        { rank: 10, nick: "player10" }, { rank: 11, nick: "player11" }, { rank: 12, nick: "player12" },
        { rank: 13, nick: "player13" }, { rank: 14, nick: "player14" }, { rank: 15, nick: "player15" },
        { rank: 16, nick: "player16" }, { rank: 17, nick: "player17" }, { rank: 18, nick: "player18" },
        { rank: 19, nick: "player19" }, { rank: 20, nick: "player20" }, { rank: 21, nick: "player21" },
        { rank: 22, nick: "player22" }, { rank: 23, nick: "player23" }, { rank: 24, nick: "player24" },
        { rank: 25, nick: "player25" }, { rank: 26, nick: "player26" }, { rank: 27, nick: "player27" },
        { rank: 28, nick: "player28" }, { rank: 29, nick: "player29" }, { rank: 30, nick: "player30" }];

        //更新
        this.ScrollList.getComponent("ScrollList").setData(data);

    }

}